{extend name="common/main"/}

{block name="body"}
<div class="main-title">
    <h2>{:lang("_NAVIGATION_MANAGEMENT_")}</h2>
</div>


<div class="with-padding">
    <div class="">
        <a href="javascript:" class="btn btn-info add-new">新增导航</a>
    </div>
    <form action="{:Url()}" method="post" class="form-horizontal" >
    <ul class="channel-ul">
    {volist name="list" id="nav"}
        {include file="channel/_li"/}
    {/volist}
    </ul>
    <div class="form-item">
        <button class="btn btn-warning submit-btn ajax-post no-refresh" id="submit" type="submit" target-form="form-horizontal">{:lang("_SURE_WITH_SPACE_")}</button>
        <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">{:lang("_RETURN_WITH_SPACE_")}</button>
    </div>
    </form>
</div>

<div id="one-nav" class="hide">
    <li class="clearfix pLi" >
        <input name="nav[1][sort][]" class="sort" style="display: none" >
        <div class="pull-left nav_list">
            <select name="nav[1][type][]" class="form-control nav-type" style="width: 100px;">
                <option value="module" >{:lang("_SYSTEM_MODULE_")}</option>
                <option value="custom" >{:lang("_CUSTOM_")}</option>
            </select>

            <select name="nav[1][module][]" class="form-control module" style="width: 100px;">
                {php}foreach($module as $k=>$v){{/php}
                <option value="{$v.entry}"  data-icon="{$v.icon}" >{$v.alias}</option>
                {php}}unset($k,$v){/php}
            </select>

            <input name="nav[1][title][]" placeholder={:lang("_PLEASE_ENTER_THE_TITLE_WITH_DOUBLE_")} class="form-control title" style="width: 100px;" value="{$module.0.alias}">

            <input name="nav[1][url][]" placeholder={:lang("_PLEASE_ENTER_A_LINK_WITH_DOUBLE_")}  class="form-control url" style="width: 300px;display:none" value="{$module.0.entry}">

        </div>

        
        <div class='pull-left new-blank ' >
            <input name="nav[1][target][]" class="target_input" value="0">
            <label title={:lang("_THE_NEW_WINDOW_OPENS_WITH_DOUBLE_")}> <input class="target" type="checkbox" value="1">{:lang("_NEW_WINDOW_OPENS_")}</label>
        </div>

        <div class='pull-left band-text'>
            <input name="nav[1][band_text][]" class="form-control" placeholder={:lang("_SIGN_POINTS_WITH_DOUBLE_")}  style="width: 100px;" value="">
        </div>

        <div class='pull-left color-chose' title={:lang("_SELECT_THE_FLAG_COLOR_WITH_DOUBLE_")}>
            <input name="nav[1][band_color][]" class='simple_color_callback' value="#000000"/>
        </div>

        <div class='pull-right i-list'>

            <a href="javascript:" title={:lang("_ADD_A_NAVIGATION_WITH_DOUBLE_")}  class="add-one"><i class="icon icon-plus"></i></a>
            <a href="javascript:" title={:lang("_REMOVE_THIS_NAVIGATION_WITH_DOUBLE_")} class="remove-li"><i class="icon icon-remove"></i></a>
            <a href="javascript:" title={:lang("_ADD_CHILD_NAVIGATION_WITH_DOUBLE_")} class="add-child"><i class="icon icon-sitemap"></i></a>
            <a href="javascript:" title={:lang("_MOBILE_NAVIGATION_SORT_WITH_DOUBLE_")}><i class="icon icon-move sort-handle-1"></i></a>
        </div>

    </li>

</div>

    <div id="two-nav" class="hide">

        <li class="clearfix" >
            <input name="nav[2][pid][]" class="pid" style="display: none">
            <input name="nav[2][sort][]" class="sort" style="display: none" >
            <div class="pull-left nav_list">

                <select name="nav[2][type][]" class="form-control nav-type" style="width: 100px;">
                    <option value="module" >{:lang("_SYSTEM_MODULE_")}</option>
                    <option value="custom" >{:lang("_CUSTOM_")}</option>
                </select>

                <select name="nav[2][module][]" class="form-control module" style="width: 100px;">
                    {php}foreach($module as $k=>$v){{/php}
                    <option value="{$v.entry}" data-icon="{$v.icon}" >{$v.alias}</option>
                    {php}}unset($k,$v){/php}
                </select>

                <input name="nav[2][title][]" placeholder={:lang("_PLEASE_ENTER_THE_TITLE_WITH_DOUBLE_")} class="form-control title" style="width: 100px;" value="{$module.0.alias}">

                <input name="nav[2][url][]" placeholder={:lang("_PLEASE_ENTER_A_LINK_WITH_DOUBLE_")}  class="form-control url" style="width: 300px;display:none" value="{$module.0.entry}">

            </div>
            
            <div class='pull-left new-blank ' >
                <input name="nav[2][target][]" class="target_input" value="0">
                <label title={:lang("_THE_NEW_WINDOW_OPENS_WITH_DOUBLE_")}> <input class="target"  type="checkbox" value="1">{:lang("_NEW_WINDOW_OPENS_")}</label>
            </div>





            <div class='pull-left band-text'>
                <input name="nav[2][band_text][]" class="form-control" placeholder={:lang("_SIGN_POINTS_WITH_DOUBLE_")}  style="width: 100px;" value="">
            </div>

            <div class='pull-left color-chose' title={:lang("_SELECT_THE_FLAG_COLOR_WITH_DOUBLE_")}>
                <input name="nav[2][band_color][]" class='simple_color_callback' value="#000000"/>
            </div>

            <div class='pull-right i-list'>

                <a href="javascript:" title={:lang("_ADD_NAVIGATION_WITH_DOUBLE_")}  class="add-two"><i class="icon icon-plus"></i></a>
                <a href="javascript:"  title={:lang("_REMOVE_THIS_NAVIGATION_WITH_DOUBLE_")} class="remove-li"><i class="icon icon-remove"></i></a>

                <a href="javascript:" title={:lang("_MOBILE_NAVIGATION_SORT_WITH_DOUBLE_")}><i class="icon icon-move sort-handle-2"></i></a>
            </div>
        </li>
    </div>
{/block}

{block name="script"}
    <script src="__LIB__/jquery.simple-color/jquery.simple-color.js"></script>
    <script src="__ZUI__/lib/sortable/zui.sortable.min.js"></script>
    <script>
        $.muu.channel_sort();
        $.muu.channel_bind_color();
    </script>
{/block}